/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.core.database;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * 
 * @author himanasser
 */
public class ConnectionFactory {
	static Connection createConnection() {
		try {
			return DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/mydb", "root", "root");
		} catch (Exception ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex.getMessage(), ex);
		}
	}

	static {
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (Exception ex) {
			ex.printStackTrace();
			throw new RuntimeException(ex.getMessage(), ex);
		}
	}

}
